3.26.23 \(\int x^{-1-n} (a+b x^n) \, dx\) [2523]

Optimal. Leaf size=16 \[ -\frac {a x^{-n}}{n}+b \log (x) \]

[Out]

-a/n/(x^n)+b*ln(x)

________________________________________________________________________________________

Rubi [A]
time = 0.00, antiderivative size = 16, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.067, Rules used = {14} \begin {gather*} b \log (x)-\frac {a x^{-n}}{n} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[x^(-1 - n)*(a + b*x^n),x]

[Out]

-(a/(n*x^n)) + b*Log[x]

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rubi steps

\begin {align*} \int x^{-1-n} \left (a+b x^n\right ) \, dx &=\int \left (\frac {b}{x}+a x^{-1-n}\right ) \, dx\\ &=-\frac {a x^{-n}}{n}+b \log (x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.02, size = 21, normalized size = 1.31 \begin {gather*} -\frac {a x^{-n}}{n}+\frac {b \log \left (x^n\right )}{n} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[x^(-1 - n)*(a + b*x^n),x]

[Out]

-(a/(n*x^n)) + (b*Log[x^n])/n

________________________________________________________________________________________

Maple [A]
time = 0.03, size = 17, normalized size = 1.06

method result size
risch \(-\frac {a \,x^{-n}}{n}+b \ln \left (x \right )\) \(17\)
norman \(\left (b \ln \left (x \right ) {\mathrm e}^{n \ln \left (x \right )}-\frac {a}{n}\right ) {\mathrm e}^{-n \ln \left (x \right )}\) \(25\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^(-1-n)*(a+b*x^n),x,method=_RETURNVERBOSE)

[Out]

-a/n/(x^n)+b*ln(x)

________________________________________________________________________________________

Maxima [A]
time = 0.29, size = 16, normalized size = 1.00 \begin {gather*} b \log \left (x\right ) - \frac {a}{n x^{n}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^(-1-n)*(a+b*x^n),x, algorithm="maxima")

[Out]

b*log(x) - a/(n*x^n)

________________________________________________________________________________________

Fricas [A]
time = 0.42, size = 21, normalized size = 1.31 \begin {gather*} \frac {b n x^{n} \log \left (x\right ) - a}{n x^{n}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^(-1-n)*(a+b*x^n),x, algorithm="fricas")

[Out]

(b*n*x^n*log(x) - a)/(n*x^n)

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 110 vs. \(2 (10) = 20\).
time = 1.35, size = 110, normalized size = 6.88 \begin {gather*} \begin {cases} a x + b \log {\left (x \right )} & \text {for}\: n = -1 \\\left (a + b\right ) \log {\left (x \right )} & \text {for}\: n = 0 \\- \frac {a n}{n^{2} x^{n} + n x^{n}} - \frac {a}{n^{2} x^{n} + n x^{n}} - \frac {b n x^{n} \log {\left (x^{- n} \right )}}{n^{2} x^{n} + n x^{n}} + \frac {b n x^{n}}{n^{2} x^{n} + n x^{n}} - \frac {b x^{n} \log {\left (x^{- n} \right )}}{n^{2} x^{n} + n x^{n}} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**(-1-n)*(a+b*x**n),x)

[Out]

Piecewise((a*x + b*log(x), Eq(n, -1)), ((a + b)*log(x), Eq(n, 0)), (-a*n/(n**2*x**n + n*x**n) - a/(n**2*x**n +
 n*x**n) - b*n*x**n*log(x**(-n))/(n**2*x**n + n*x**n) + b*n*x**n/(n**2*x**n + n*x**n) - b*x**n*log(x**(-n))/(n
**2*x**n + n*x**n), True))

________________________________________________________________________________________

Giac [A]
time = 0.75, size = 21, normalized size = 1.31 \begin {gather*} \frac {b n x^{n} \log \left (x\right ) - a}{n x^{n}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^(-1-n)*(a+b*x^n),x, algorithm="giac")

[Out]

(b*n*x^n*log(x) - a)/(n*x^n)

________________________________________________________________________________________

Mupad [B]
time = 1.41, size = 29, normalized size = 1.81 \begin {gather*} \left \{\begin {array}{cl} \ln \left (x\right )\,\left (a+b\right ) & \text {\ if\ \ }n=0\\ b\,\ln \left (x\right )-\frac {a}{n\,x^n} & \text {\ if\ \ }n\neq 0 \end {array}\right . \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*x^n)/x^(n + 1),x)

[Out]

piecewise(n == 0, log(x)*(a + b), n ~= 0, b*log(x) - a/(n*x^n))

________________________________________________________________________________________